#include <OSProc.h>

  int MM_INIT();
  inline int HaveVisitedMemory(_pcb* pro,_ptlong* vMem);
  inline int HaveVisitedMemory(_ptlong phyMem);
  inline void PushAbandenedMemory(_ptlong* phyMem);
  inline void PushBufferMemory(_ptlong* phyMem);
  template<typename T>
  inline int CheckBufferMemoryValidThen(_pcb* pro,_ptlong* vMem,T fun);
  inline int LockMemory(_pcb* pro,_ptlong* vMem);
  inline int UnlockMemory(_pcb* pro,_ptlong* vMem);
  inline int CopyOnWrite(_pcb* pro,_ptlong*vMem,_ptlong* phyAddr);
  inline int CopyOnWrite(_pcb* proA,_ptlong* vMemA,_pcb* proB,_ptlong* vMemB);
  inline _ptlong CopyOnWrite_Swapout(_pcb* pro,_ptlong* vMem);
  inline _ptlong CopyOnWrite_Swapin(_pcb* pro,_ptlong* vMem,_ptlong* phyAddr);
